/**
*      author: Y_Yao
*      created: 2024-09-19 00:08:13
**/

#include<bits/stdc++.h>

using namespace std;

void solve()
{
        int a,b;
        cin >> a >> b;
        int sum =0;
        sum = a + 2 * b;
        if(a==2 && b == 0)
        {
            cout<<"YES"<<endl;
            return;
        }
        if(sum % 2 == 1)
        {
            cout<< "NO"<<endl;
            return;
        }
        if((sum / 2) % 2 == 1 && a == b)
        {
            cout << "YES"<<endl;
            return;
        }
        if((sum / 2) % 2 == 0)
        {
            cout << "YES"<<endl;
            return;
        }
        cout<<"NO"<<endl;
}

int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    int t =0 ;
    cin >> t;
    while(t--)
    {

        solve();
    }
    return 0;
}